# ---------------------------------------------------------------------------------------------------- #
Title: You and Whose Army? How Civilian Leaders Leverage the Military’s Prestige to Shape Public Opinion
Authors: Michael R. Kenwick and Sarah R. Maxey
Contact: Michael R. Kenwick <mikekenwick@gmail.com>
Date: 08/28/2021
# ---------------------------------------------------------------------------------------------------- #

All analyses were run locally on a Mac running Catalina 10.15.2 (2.3 GHz 8-Core, 16GB Ram). Scripts
in R were executed using R version 4.0.2. Older versions of R may return slightly different results
due to changes in the random number generator. Stata analyses run using version 12.1.

Scripts can be run in any order and are described below. Be sure to switch the working directory 
command in each to the location of the replication folder. 

# ---------------------------------------------------------------------------------------------------- #
NECESSARY PACKAGES: prior to running the R code, you should install the following packages:

	install.packages("ggplot2")
	install.packages("dplyr")
	install.packages("foreign")
	install.packages("haven")
	install.packages("jtools")
	install.packages("huxtable")
	install.packages("officer")
	install.packages("flextable")
	install.packages("VGAM")
	install.packages("ggplot2")
	install.packages("dplyr")
	install.packages("foreign")
	install.packages("haven")
	install.packages("jtools")
	install.packages("huxtable")
	install.packages("officer")
	install.packages("flextable")
	install.packages("VGAM")

# ---------------------------------------------------------------------------------------------------- #
FILES AND FOLDER STRUCTURE

01_experimental_analysis_private.R - Conducts primary experimental analysis in the main text and appendix
02_speech_analysis.R - Conducts the text analysis in the main text and appendix
03_pretest_analysis.do - Conducts analyses on pre-test data reported in the appendix
codebook.xlsx - codebook labeling variables in base data sets
experiment (FOLDER) - Contains data files from the survey experiment and pre-test
	survey_results.csv - Output data from the primary experiment
	pretest.dta - Pre-test data analyzed in the appendix. 
README.txt - The file you are currently reading. 
results (FOLDER) - This is an empty folder that will be populated with results when running analysis 
	scripts
speech_analysis - Contains the base data for the speech analysis
	iraq_monthly_03to08.csv - Iraq fatality data
	metadata.csv - metadata for presidential speeches
	speech_text(FOLDER) - Contains files for each presidential speech named LocationYear-ID.txt






